package com.order.itemcategoryproject.service.lmpl;

import com.order.itemcategoryproject.mapper.dArcItemPicMapper;
import com.order.itemcategoryproject.pojo.dArcItemPic;
import com.order.itemcategoryproject.service.dArcItemPicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class dArcItemPicServicelmpl implements dArcItemPicService {

    @Autowired
    private dArcItemPicMapper dArcItemPicMapper;

    /**
     * 根据商品编号获取当前商品图片信息
     * @param itemId
     * @return
     */
    @Override
    public dArcItemPic getItemPicByItemId(String itemId) {
        return dArcItemPicMapper.getItemPicByItemId(itemId);
    }


    /**
     * 如果状态是000 那么更新状态，时间，备注
     * @param itemId
     * @param clbz
     */
    @Override
    public int updateItemPicInfoByItemId(String itemId, String clbz) {
        return dArcItemPicMapper.updateItemPicInfoByItemId(itemId, clbz);
    }

    /**
     * 如果状态为001 那么只更新备注和添加时间
     * @param itemId
     * @param clbz
     */
    @Override
    public int updateItemPicByItemIdAndClbz(String itemId, String clbz) {
       return dArcItemPicMapper.updateItemPicByItemIdAndClbz(itemId, clbz);
    }
}
